import Taro from "@tarojs/taro";
import { Component } from "react";
import "./app.scss";

class App extends Component {
  componentDidMount() {
    if (Taro.getStorageSync("accessToken")) {
      Taro.reLaunch({
        url: "/pages/index/index",
      });
    } else {
      Taro.reLaunch({
        url: "/pages/welcome/welcome",
      });
    }
  }

  componentDidShow() {}

  componentDidHide() {}

  render() {
    // this.props.children 是将要会渲染的页面
    return this.props.children;
  }
}

export default App;
